package com.frejoys.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.frejoys.common.aop.Authority;
import com.frejoys.common.aop.Authorization;
import com.frejoys.common.constant.CommonConstant;
import com.frejoys.common.dto.admin.UserLevelListDto;
import com.frejoys.common.dto.common.PageDto;
import com.frejoys.common.response.Result;
import com.frejoys.common.vo.admin.UserLevelAgentVo;
import com.frejoys.service.UserLevelService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Tag(name = "用户关联管理", description = "用户关联管理")
@RestController
@RequiredArgsConstructor
@RequestMapping(CommonConstant.routePrefixAdmin)
@Authorization(Authority.Private)
public class AdminUserLevelController {

    private final UserLevelService userLevelService;

    @PostMapping("/userLevel/userLevelListInfo")
    @Operation(summary = "查询用户关联列表")
    public Result<IPage<UserLevelAgentVo>> userLevelListInfo(@RequestBody @Validated UserLevelListDto dto){
        return Result.success(userLevelService.userLevelListInfo(dto));
    }

}
